Get the key, value, and countΒΆ

Get the key, value and count in a dictionary
D = {'a': 41, 'b': 42, 'c': 43, 'd': 44, 'e': 45, 'f': 46}

print("id\t key\t value")

for id, (key, value) in enumerate(D.items(), 1):
    print(id, '\t', key, '\t', value)

Output:

id    key   value
1     a     41
2     b     42
3     c     43
4     d     44
5     e     45
6     f     46